package service.impl;

import service.UserService;

/**
 * 真实主题类：用户服务实现
 * 包含核心的业务逻辑
 */
public class UserServiceImpl implements UserService {
    
    @Override
    public boolean addUser(String username, String password) {
        System.out.println("添加用户: " + username);
        // 模拟业务逻辑处理
        try {
            Thread.sleep(100); // 模拟耗时操作
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        return true;
    }
    
    @Override
    public boolean deleteUser(String username) {
        System.out.println("删除用户: " + username);
        // 模拟业务逻辑处理
        try {
            Thread.sleep(100); // 模拟耗时操作
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        return true;
    }
    
    @Override
    public String getUser(String username) {
        System.out.println("查询用户: " + username);
        // 模拟业务逻辑处理
        try {
            Thread.sleep(100); // 模拟耗时操作
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
        return "用户信息: " + username;
    }
}